﻿using System;

class MissCat2011
{
    static void Main(string[] args)
    {
        System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;

        int numberOfVotes = int.Parse(Console.ReadLine());
        int[] votesArray = new int[10];

        for (int currentVoteCount = 0; currentVoteCount < numberOfVotes; currentVoteCount++)
        {
            byte currentVote = byte.Parse(Console.ReadLine());
            votesArray[currentVote-1]++;
        }

        int maxVote = 0;
        int bestCat = 0;

        for (int currentVote = 9; currentVote >= 0; currentVote--)
        {
            if (votesArray[currentVote] >= maxVote)
            {
                maxVote = votesArray[currentVote];
                bestCat = currentVote;
            }
        }
        Console.WriteLine(bestCat+1);

    }
}
